/*
 * main.c
 *
 *  Created on: 2012-3-4
 *      Author: wutao
 */
#include "network.h"
#include "netio.h"
#include "ioevent.h"

#include <string.h>


int main(int c, char **v) {
	Network network;

	struct sockaddr_in local;
	memset(&local,0, sizeof(local));
	uint16_t port= 3480;
	local.sin_family = AF_INET;
	local.sin_port = htons(port);
	local.sin_addr.s_addr = htons(INADDR_ANY);

	network.addr = (struct sockaddr *)&local;
	network.port = 9443;
	//network->rece_buf_size;
	//network->send_buf_size;
	network.overload = 10000;

	network.connected = newconn;
	network.closed = closed;
	network.received = requested;
	network.sent = responsed;
	network.error = errored;

	NetIO netIO;
	netIO.decode = decodec;
	netIO.encode = encodec;
//
	start_work(&network, &netIO);
	return 0;
}
